#include "./../../Headers/mathematics/math_except.h"

#ifdef AlLOW_EXCEPT
#define DEBUG_BOUND_EXCEPT
#endif

namespace Mathematics {

	OutOfBoundsException::OutOfBoundsException(const string &message, const uint &bound, const uint &access)
		:Wtb(), error(message),bound(bound),access(access){
#ifdef DEBUG_BOUND_EXCEPT
		debug_function_info( "Constructor: ", "OutOfBoundsException", (int) &( *this ), sizeof( *this ) );
		cout << "Bound: " << bound << pendl;
		cout << "Access: " << access << pendl << endl;
#endif
	};
	
	OutOfBoundsException::OutOfBoundsException(const OutOfBoundsException &original)
		:Wtb(original), error(original.error),bound(original.bound),access(original.access){
#ifdef DEBUG_BOUND_EXCEPT
		debug_function_info( "Copy Constructor: ", "OutOfBoundsException", (int) &( *this ), sizeof( *this ) );
		cout << "Bound: " << bound << pendl;
		cout << "Access: " << access << pendl << endl;
#endif
	};
	
	OutOfBoundsException::~OutOfBoundsException(){
#ifdef DEBUG_BOUND_EXCEPT
		debug_function_info( "Destructor: ", "OutOfBoundsException", (int) &( *this ), sizeof( *this ) );
		cout << "Bound: " << bound << pendl;
		cout << "Access: " << access << pendl << endl;
#endif
	};
	
	bool OutOfBoundsException::filePrint( FILE *parq ) const {
		return fprintf( parq, "%s", toS().c_str() ) == 1;
	};
};
